package com.wyg.learn.customer;

import com.wyg.learn.netty.NettyClient;
import com.wyg.learn.service.Arithmetic;

/**
 * @description:
 * @author: WYG
 * @time: 2020/10/10 10:16
 */

public class ClientBoot {

    //这里定义协议头
    public static final String providerName = "Arithmetic#";

    public static void main(String[] args) {
        //创建消费者
        NettyClient customer = new NettyClient();
        //创建代理对象
        Arithmetic arithmetic = (Arithmetic) customer.getBean(Arithmetic.class, providerName);
        //通过代理对象调用服务提供者的方法
        int res = arithmetic.multiply(5,2);
        System.out.println("调用结果 res=" + res);
    }
}
